package com.train.springboot.springboottrain.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@Controller
public class UserDetailController {
    @RequestMapping(value = "/user2/detail")
    public @ResponseBody Object userDetail(){
        Map<String,Object> retMap = new HashMap<>();
        retMap.put("id",1001);
        retMap.put("age","lisa");
        return retMap;
    }
    @RequestMapping(value = "/user2/page/detail")
    public String userPageDetail(Model model){
        model.addAttribute("id",2021);
        model.addAttribute("username","wangwu");
        return "userDetail";
    }

}
